#include <stdio.h>  
#include <math.h>  
  
int main() {  
    int xNum, xDeno, yNum, yDeno, ansNum = 1, ansDeno = 1, gcd;  
    char c;  
    if (scanf("%d/%d %c %d/%d", &xNum, &xDeno, &c, &yNum, &yDeno));  
    switch (c) {  
        case '+':  
            ansNum = xNum * yDeno + xDeno * yNum;  
            ansDeno = xDeno * yDeno;  
            break;  
        case '-':  
            ansNum = xNum * yDeno - xDeno * yNum;  
            ansDeno = xDeno * yDeno;  
            break;  
        case '*':  
            ansNum = xNum * yNum;  
            ansDeno = xDeno * yDeno;  
            break;  
        case '/':  
            ansNum = xNum * yDeno;  
            ansDeno = xDeno * yNum;  
            break;  
    }  
    int temp = (ansNum < ansDeno ? ansNum : ansDeno);  
    for (int i = temp; i > 1 ; i--) {  
        gcd = ((ansDeno % i == 0) && (ansNum % i == 0 )) ? i : 1;  
        ansDeno /= gcd;  
        ansNum /= gcd;  
    }  
    if (!ansNum)  
        printf("%d/%d %c %d/%d = %d\n", xNum, xDeno, c, yNum, yDeno, 0);  
    else if (ansDeno == 1)  
        printf("%d/%d %c %d/%d = %d\n", xNum, xDeno, c, yNum, yDeno, ansNum);  
    else  
        printf("%d/%d %c %d/%d = %d/%d\n", xNum, xDeno, c, yNum, yDeno, ansNum, ansDeno);  
    return 0;  
}  